home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Shareware Overload Trio 2
/
Shareware Overload Trio Volume 2 (Chestnut CD-ROM).ISO
/
dir37
/
ushell.zip
/
SHELL
/
SH6.C
< prev
next >
Wrap
C/C++ Source or Header
|
1990-02-19
|
4KB
|
115 lines
/* MS-DOS SHELL - Data Declarations
*
* MS-DOS SHELL - Copyright (c) 1990 Data Logic Limited and Charles Forsyth
*
* This code is based on (in part) the shell program written by Charles
* Forsyth and is subject to the following copyright restrictions:
*
* 1. Redistribution and use in source and binary forms are permitted
* provided that the above copyright notice is duplicated in the
* source form and the copyright notice in file sh6.c is displayed
* on entry to the program.
*
* 2. The sources (or parts thereof) or objects generated from the sources
* (or parts of sources) cannot be sold under any circumstances.
*
* $Header: sh6.c 1.1 90/01/25 13:42:04 MS_user Exp $
*
* $Log: sh6.c $
* Revision 1.1 90/01/25 13:42:04 MS_user
* Initial revision
*
*/
#include <sys/types.h>
#include <stddef.h>
#include <signal.h>
#include <errno.h>
#include <setjmp.h>
#include <stdlib.h>
#include <limits.h>
#include <unistd.h>
#include "sh.h"
char *Copy_Right1 = "MS-DOS SH Version 1.4\341 (DOS %d.%d)\n";
char *Copy_Right2 = "Copyright (c) Data Logic Ltd and Charles Forsyth 1990\n";
char **dolv; /* Parameter array */
int dolc; /* Number of entries in parameter array */
int exstat; /* Exit status */
char gflg;
int fn_area_number = -1; /* Next function area number */
int talking; /* interactive (talking-type wireless) */
int execflg; /* Exec mode */
int multiline; /* \n changed to ; */
int Current_Event = 0; /* Current history event */
int *failpt; /* Current fail point jump address */
int *errpt; /* Current error point jump address */
/* Swap mode */
int Swap_Mode = SWAP_EXPAND | SWAP_DISK;
Break_C *Break_List; /* Break list for FOR/WHILE */
Break_C *Return_List; /* Return list for RETURN */
Break_C *SShell_List; /* SubShell list for EXIT */
bool level0 = FALSE; /* Level Zero flag */
bool r_flag = FALSE; /* Restricted shell */
/* History processing enabled flag */
bool History_Enabled = FALSE;
Fun_Ops *fun_list = (Fun_Ops *)NULL; /* Function list */
Save_IO *SSave_IO; /* Save IO array */
int NSave_IO_E = 0; /* Number of entries in Save IO array */
int MSave_IO_E = 0; /* Max Number of entries in SSave_IO */
S_SubShell *SubShells; /* Save Vars array */
int NSubShells = 0; /* Number of entries in SubShells */
int MSubShells = 0; /* Max Number of entries in SubShells */
Word_B *wdlist; /* Current Word List */
Word_B *iolist; /* Current IO List */
long ourtrap = 0L; /* Signal detected */
int trapset; /* Trap pending */
int yynerrs; /* yacc errors detected */
int Execute_stack_depth; /* execute function recursion */
/* depth */
Var_List *vlist = (Var_List *)NULL; /* dictionary */
Var_List *path; /* search path for commands */
Var_List *ps1; /* Prompt 1 */
Var_List *ps2; /* Prompt 2 */
Var_List *C_dir; /* Current directory */
char *last_prompt; /* Last prompt output */
Var_List *ifs; /* Inter-field separator */
char *home = "HOME";
char *shell = "SHELL";
char *history_file = "HISTFILE";
char *hsymbol = "#";
char *msymbol = "-";
char *spcl2 = "$`'\"";
/* I/O stacks */
IO_Args ioargstack[NPUSH];
IO_State iostack[NPUSH];
/* Temporary I/O argument */
IO_Args temparg = {
(char *)NULL, /* Word */
(char **)NULL, /* Word list */
0, /* File descriptor */
AFID_NOBUF, /* Buffer id */
0L, /* File position */
(IO_Buf *)NULL /* Buffer */
};
int areanum; /* Current allocation area */
int inparse; /* In parser flag */
long flags = 0L; /* Command line flags */
char *null = "";
/* Current environment */
Environ e = {
(char *)NULL, /* Current line buffer */
(char *)NULL, /* Current pointer in line */
(char *)NULL, /* End of line pointer */
iostack, /* I/O Stack pointers */
iostack - 1,
(int *)NULL,
FDBASE, /* Base file handler */
(Environ *)NULL /* Previous Env pointer */
};